package top.yjp.jtf.plugin.deprecated;

import com.intellij.openapi.fileEditor.FileEditorManager;
import com.intellij.openapi.fileEditor.FileEditorManagerListener;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;

public class ExcelFileEditorManagerListener implements FileEditorManagerListener {
    @Override
    public void fileOpened(@NotNull FileEditorManager source, @NotNull VirtualFile file) {
        if (file.getName().endsWith(".xlsx") || file.getName().endsWith(".xls")) {
            // 这里可以调用打开Excel编辑器的逻辑
            FileEditorManager.getInstance(source.getProject()).openFile(file, true);
        }
    }
}
